From e6bb7084ca3c791c4339ab0396c55b8fa0c3776a Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Sun, 23 Mar 2003 21:43:43 +0000 Subject: [PATCH] bitkeeper revision 1.157 (3e7e2a8f82w4Wez8Nigyi3seahCBIA) config.h, domain.c, dom_mem_ops.c: Fixed out-of-memory handling slightly. --- xen/common/dom_mem_ops.c | 2 +- xen/common/domain.c | 2 +- xen/include/xeno/config.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/common/dom_mem_ops.c b/xen/common/dom_mem_ops.c index 07f7cf8f7d..52c4d30f90 100644 --- a/xen/common/dom_mem_ops.c +++ b/xen/common/dom_mem_ops.c @@ -40,7 +40,7 @@ static long alloc_dom_mem(struct task_struct *p, balloon_def_op_t bop) spin_lock_irqsave(&free_list_lock, flags); - if ( free_pfns < (bop.size + (SLACK_DOMAIN_MEM_KILOBYTES << + if ( free_pfns < (bop.size + (SLACK_DOMAIN_MEM_KILOBYTES >> (PAGE_SHIFT-10))) ) { spin_unlock_irqrestore(&free_list_lock, flags); diff --git a/xen/common/domain.c b/xen/common/domain.c index d8ea1078a6..99a29d2771 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -161,7 +161,7 @@ unsigned int alloc_new_dom_mem(struct task_struct *p, unsigned int kbytes) spin_lock_irqsave(&free_list_lock, flags); /* is there enough mem to serve the request? */ - if ( (req_pages + (SLACK_DOMAIN_MEM_KILOBYTES << (PAGE_SHIFT-10))) > + if ( (req_pages + (SLACK_DOMAIN_MEM_KILOBYTES >> (PAGE_SHIFT-10))) > free_pfns ) { spin_unlock_irqrestore(&free_list_lock, flags); diff --git a/xen/include/xeno/config.h b/xen/include/xeno/config.h index 0623d607db..ed08041b7d 100644 --- a/xen/include/xeno/config.h +++ b/xen/include/xeno/config.h @@ -89,7 +89,7 @@ * Amount of slack domain memory to leave in system, in megabytes. * Prevents a hard out-of-memory crunch for thinsg like network receive. */ -#define SLACK_DOMAIN_MEM_KILOBYTES 1024 +#define SLACK_DOMAIN_MEM_KILOBYTES 2048 /* Linkage for x86 */ #define FASTCALL(x) x __attribute__((regparm(3))) -- 2.30.2